<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>机构登录</title>
    <load href='__PUBLIC__/bower_components/bootstrap/dist/css/bootstrap.min.css' />
    <load href='__PUBLIC__/assets/css/min.css' />
    <load href='__PUBLIC__/jquery-1.10.0.js'/>
    <load href='__PUBLIC__/jquery.validate-1.13.1.js'/>
</head>
<body>

<script>
    $(document).ready(function () {
        $("#form-horizontal").validate({
            debug: false,
            errorPlacement: function(error, element) {
                error.appendTo(element.parent().parent().find('.error-msg'));
            },
            rules: {
                Username: {
                    required: true,
                    minlength: 6,
                    maxlength: 16
                },
                Password: {
                    required: true,
                    minlength: 6,
                    maxlength: 16
                }
            },
            messages: {
                Username: {
                    required: '*请输入用户名',
                    minlength: '*用户名不能少于6个字符',
                    maxlength: '*用户名不能超过16个字符',
                    remote: '*用户名不存在'
                },
                Password: {
                    required: '*请输入密码',
                    minlength: '*密码不能少于6个字符',
                    maxlength: '*密码不能超过16个字符'
                }
            }
        });
        $("#check").click(function () {
            console.log($("#form-horizontal").valid() ? "填写正确" : "填写不正确");
        });
    });
</script>


<div class="register">
    <form class="form-horizontal" id="form-horizontal" name="form-horizontal" method="post">
        <div class="form-group">
            <label for="Username" class="col-sm-2 control-label">用户名</label>
            <div class="col-sm-10">
                <input type="text" name="Username" id="Username" class="form-control" placeholder="用户名/手机号/邮箱">
            </div>
            <div class="error-msg"></div>
        </div>

        <div class="form-group">
            <label for="Username" class="col-sm-2 control-label">密&nbsp&nbsp&nbsp&nbsp码</label>
            <div class="col-sm-10">
                <input type="password" id="Password" name="Password" class="form-control" placeholder="密码">
            </div>
            <div class="error-msg"></div>
        </div>
        <div class="form-group">
            <a href="" target="_blank" class="pswd">忘记密码？</a>
        </div>
        <div  id="validcode" class="form-group">
            <img id="validcode-img" src="/Bailey/index.php/Pub/Code/code?v=<?php echo rand(1,999) ?>"  width="200" height="60" onclick="this.src='/Bailey/index.php/Pub/Code/code?d='+Math.random();" />
            <input type="text" name="code" id="validcode-input" class="form-control" placeholder="验证码">
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" name="submit"  value="2" class="btn btn-default">登录</button>
            </div>
        </div>

    </form>
    <?php
		if($_SESSION['username']){
			echo $_SESSION['username'].$_SESSION['id'];
		}
	?>

</div>
</body>
</html>